/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.unitn.science.matr155863_148346_145963.bccastestore.items;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 *
 * @author Luciano
 */
public class Offer {
    
    private Integer id;
    private Integer buyerId;
    private Float maxPrice;
    private Date date;
    private Integer astaId;
    private User buyer;
    private Asta asta;
    private Float actualPrice;
    
    public Offer(){
        
    }

    public Offer(int id, float actualPrice, float maxPrice, long time, int buyerId, int astaId) {
        this.id=id;
        this.actualPrice=actualPrice;
        this.maxPrice=maxPrice;
        this.date=new Date(time);
        this.buyerId=buyerId;
        this.astaId=astaId;
    }

    public Float getMaxPrice() {
        return maxPrice;
    }

    public void setMaxPrice(Float max_offer) {
        this.maxPrice = max_offer;
    }

    public User getBuyer() {
        return buyer;
    }

    public void setBuyer(User buyer) {
        this.buyer = buyer;
    }

    public Asta getAsta() {
        return asta;
    }

    public void setAsta(Asta asta) {
        this.asta = asta;
    }

    
    
    public Integer getBuyerId() {
        return buyerId;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    
    public void setBuyerId(Integer buyerId) {
        this.buyerId = buyerId;
    }

  

    public Integer getAstaId() {
        return astaId;
    }

    public void setUmId(Integer astaId) {
        this.astaId = astaId;
    }
    
    public Integer getId() {
        return id;
    }
    public void setId(int id) {
        this.id= id;
    }
    

    public Date getDate() {
        return date;
    }
    
    public String getHumanDate(){
        SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss",Locale.ITALIAN);
            sf.setLenient(false);
            return sf.format(date);
    }
    
    public void setDate(Date dat) {
        date=dat;
    }

    public void setBuyer(Integer buyId) {
        buyerId=buyId;
    }

    public void setAstaId(Integer astaId) {
        this.astaId= astaId;
    }

    public void setActualPrice(Float actualPrice) {
        this.actualPrice=actualPrice;
    }

    public Float getActualPrice() {
        return actualPrice;
    }
    
    

    
}
